import toml

def get_config(path:str=None):
    """Returns the current configuration as a dictionary."""
    return toml.load(path)

def write_config(path:str,tmp_config):
    """Writes a key-value pair to the config file."""
    with open(path, 'w') as f:
        toml.dump(tmp_config, f)
    config = tmp_config  # Update the in-memory config